/* This file is part of GSMC.
 * 
 * GSMC is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * GSMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with GSMC.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.hpxn.gsmc.core.server;

import java.util.ArrayList;

public class ServerManager {
	private static ArrayList<Server> serverList = new ArrayList<Server>();

	public static int getTotalPlayers() {
		int totalPlayers = 0;
		for ( Server wServer : serverList ) {
			totalPlayers += wServer.getPlayerCount();
		}
		return totalPlayers;
	}

	public static int getMaxPlayers() {
		int maxPlayers = 0;
		for ( Server wServer : serverList ) {
			maxPlayers += wServer.getMaxPlayers();
		}
		return maxPlayers;
	}

	public static ArrayList<Server> getServerList() {
		return serverList;
	}

	public static void add( Server pServer ) {
		pServer.startupActions();
		serverList.add( pServer );
	}

	public static void remove( Server pServer ) {
		serverList.remove( pServer );
	}
}
